package co.baiku.boot.im.easemob.request;

import co.baiku.boot.common.tools.StringTools;
import co.baiku.boot.config.EasemobImConfig;
import co.baiku.boot.im.easemob.model.EasemobFile;
import co.baiku.boot.im.easemob.model.MessageType;

import java.util.UUID;

public class EasemobMsgImg extends EasemobMsg {
    private String filename = UUID.randomUUID().toString() + ".jpg";
    private String secret;
    private String url;

    public EasemobMsgImg(EasemobFile easemobFile, EasemobImConfig easemobImConfig) {
        super(MessageType.img);
        this.secret = easemobFile.getShareSecret();
        this.url = "https://a1.easemob.com/" + easemobImConfig.getOrgName() + StringTools.VIRGULE + easemobImConfig.getAppName() + "/chatfiles/" + easemobFile.getUuid();
    }

    public String getFilename() {
        return filename;
    }

    public void setFilename(String filename) {
        this.filename = filename;
    }

    public String getSecret() {
        return secret;
    }

    public void setSecret(String secret) {
        this.secret = secret;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }
}
